package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FormDataMapper;
import com.ruoyi.system.domain.FormData;
import com.ruoyi.system.service.IFormDataService;

/**
 * 单内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-16
 */
@Service
public class FormDataServiceImpl extends ServiceImpl<FormDataMapper,FormData> implements IFormDataService
{
    @Autowired
    private FormDataMapper formDataMapper;

    /**
     * 查询单内容
     * 
     * @param id 单内容主键
     * @return 单内容
     */
    @Override
    public FormData selectFormDataById(Long id)
    {
        return formDataMapper.selectFormDataById(id);
    }

    /**
     * 查询单内容列表
     * 
     * @param formData 单内容
     * @return 单内容
     */
    @Override
    public List<FormData> selectFormDataList(FormData formData)
    {
        return formDataMapper.selectFormDataList(formData);
    }

    /**
     * 新增单内容
     * 
     * @param formData 单内容
     * @return 结果
     */
    @Override
    public int insertFormData(FormData formData)
    {
        formData.setCreateTime(DateUtils.getNowDate());
        return formDataMapper.insertFormData(formData);
    }

    /**
     * 修改单内容
     * 
     * @param formData 单内容
     * @return 结果
     */
    @Override
    public int updateFormData(FormData formData)
    {
        formData.setUpdateTime(DateUtils.getNowDate());
        return formDataMapper.updateFormData(formData);
    }

    /**
     * 批量删除单内容
     * 
     * @param ids 需要删除的单内容主键
     * @return 结果
     */
    @Override
    public int deleteFormDataByIds(Long[] ids)
    {
        return formDataMapper.deleteFormDataByIds(ids);
    }

    /**
     * 删除单内容信息
     * 
     * @param id 单内容主键
     * @return 结果
     */
    @Override
    public int deleteFormDataById(Long id)
    {
        return formDataMapper.deleteFormDataById(id);
    }
}
